package o;

import androidx.annotation.NonNull;
import java.util.Collections;
import java.util.Set;
import java.util.WeakHashMap;

public class yh implements yo {
    private boolean ˊ;
    private final Set<ym> ˎ = Collections.newSetFromMap(new WeakHashMap());
    private boolean ॱ;

    public void ॱ(@NonNull ym ymVar) {
        this.ˎ.add(ymVar);
        if (this.ॱ) {
            ymVar.onDestroy();
        } else if (this.ˊ) {
            ymVar.onStart();
        } else {
            ymVar.onStop();
        }
    }

    public void ˎ(@NonNull ym ymVar) {
        this.ˎ.remove(ymVar);
    }

    public void ˎ() {
        this.ˊ = true;
        for (ym onStart : aau.ˏ(this.ˎ)) {
            onStart.onStart();
        }
    }

    public void ˏ() {
        this.ˊ = false;
        for (ym onStop : aau.ˏ(this.ˎ)) {
            onStop.onStop();
        }
    }

    public void ॱ() {
        this.ॱ = true;
        for (ym onDestroy : aau.ˏ(this.ˎ)) {
            onDestroy.onDestroy();
        }
    }
}
